package com.assembler.app.genome;

/**
 * This class generates Genome with specific length that consist of random
 * elements.
 *
 * This class is a part of the lab rotation project for PhD  students in January 2014.
 * School of Computing
 * National University Singapore.
 * 
 * @author Iana Pyrogova, Abha Belorkar
 * @version 1.0.1
 */
public class GenomeGenerator {

	private char[] genomAlphabet = { 'A', 'G', 'C', 'T' };

	public Genome generateGenom(int genomLength) {
		char[] result = new char[genomLength];
		for (int i = 0; i < genomLength; i++) {
			// TODO Check if rounding correct;
			int alphabetIndex = (int) Math.round((Math.random() * 3));
			result[i] = genomAlphabet[alphabetIndex];
		}
		return new Genome(result.toString());
	}
}
